package me.isaac.learn_scala.ch06

class Stock(val code: String, val name: String) {
	private var price = 1.5

	def this(code: String, name: String, price: Double) {
		this(code, name)
		this.price = price
		println("Stock辅助构造器")
	}
}

object Stock {
	def apply(code: String, name: String): Stock = {
		println("Stock伴生对象apply")
		new Stock(code, name)
	}
}